import { request } from '@umijs/max';

// 获取资源列表
export async function resourceList(params: any) {
  return request('/api/sys/resource/listTree', {
    method: 'GET',
    params,
  });
}

// 新增资源
export async function resourceAdd(data: any) {
  return request('/api/sys/resource/add', {
    method: 'POST',
    data,
  });
}

// 更新资源
export async function resourceUpdate(data: any) {
  return request('/api/sys/resource/update', {
    method: 'PUT',
    data,
  });
}

// 删除资源
export async function resourceDelete(params: any) {
  return request('/api/sys/resource/delete', {
    method: 'DELETE',
    params,
  });
}

// 获取资源详情
export async function resourceDetail(params: any) {
  return request('/api/sys/resource/detail', {
    method: 'GET',
    params,
  });
}
